package com.yhh.weixin.service;

import com.yhh.common.base.ret.ApiResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 微信服务相关接口设计
 */
@Api(tags = "微信服务相关API")
@RestController
@RequestMapping("weixin/api/v1")
public interface WeixinService {

    /**
     * 获取微信二维码字符串
     * @return
     */
    @ApiOperation(value = "获取微信二维码字符串")
    @GetMapping("getWXQRCode")
    ApiResult getWXQRCode(@RequestParam("state") String state);

    /**
     * 通过code获取网页授权(access_token, open_id)
     * @return
     */
    @ApiOperation(value = "通过code获取网页授权(access_token, open_id)")
    @GetMapping("getAccessToken")
    ApiResult getAccessToken(@RequestParam("code") String code);

    /**
     * 通过(access_token, open_id)拉取用户信息
     * @return
     */
    @ApiOperation(value = "通过(access_token, open_id)拉取用户信息")
    @GetMapping("getWXUserinfo")
    ApiResult getWXUserinfo(@RequestParam("accessToken") String accessToken,@RequestParam("openId") String openId);
}
